//
//  AllAddressCell.m
//  JiuLe
//
//  Created by SunChao on 16/10/31.
//  Copyright © 2016年 Fine. All rights reserved.
//

#import "AllAddressCell.h"

@implementation AllAddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(void)setModel:(AddressModel *)model
{
    _model = model;
    _nameLabel.text = [NSString stringWithFormat:@"%@ %@",model.name,model.tel];
    _addressLabel.text = [NSString stringWithFormat:@"%@-%@-%@-%@",model.province,model.city,model.district,model.address];
    [self.defaultAddressBtn setImage:[UIImage imageNamed:@"enselect"] forState:UIControlStateNormal];
    [self.defaultAddressBtn setImage:[UIImage imageNamed:@"right"] forState:UIControlStateSelected];
    [self.defaultAddressBtn setTitle:@"设为默认" forState:UIControlStateNormal];
    [self.defaultAddressBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.defaultAddressBtn setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
    [self.defaultAddressBtn setTitle:@"设为默认" forState:UIControlStateSelected];
     [self.defaultAddressBtn setImageEdgeInsets :UIEdgeInsetsMake(0, 0, 0, 20)];
     [self.defaultAddressBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
    
    [self.editorBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
    [self.editorBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateSelected];
     self.editorBtn.imageEdgeInsets = UIEdgeInsetsMake(0,0,20,20);
    [self.editorBtn setTitle:@"编辑" forState:UIControlStateNormal];
    [self.editorBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.editorBtn setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
    [self.editorBtn setTitle:@"编辑" forState:UIControlStateSelected];
    [self.editorBtn setImageEdgeInsets :UIEdgeInsetsMake(0, 0, 0, 20)];
    [self.editorBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
    
   
}


@end
